package org.edu.modules.stu.base.service;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.edu.common.base.BaseService;
import org.edu.common.base.BasePageDto;
import org.edu.common.utils.ConvertUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.edu.modules.stu.base.entity.VeStuFamily;
import org.edu.modules.stu.base.dto.VeStuFamilyDto;

/**
 * service-家庭成员管理
 *
 * @author Erik Zhang
 * @version 1.0
 * @since 2021-04-08
 */
public interface VeStuFamilyService extends BaseService<VeStuFamily> {

    IPage<VeStuFamilyDto> pageDto(BasePageDto page, @Param(Constants.WRAPPER) Wrapper queryWrapper);
    /**
    * 查询实体类
    */
    VeStuFamilyDto findDtoById(String id);

    /**
    * 新增或者修改
    */
    void insertOrUpdate(VeStuFamilyDto dto, Boolean isAdd);


    @Delete("delete from ve_stu_family where stu_id=#{stuId}")
    void deleteByStuId(@Param("stuId") Integer stuId);

    @Select("select name from ve_base_dict_area where id = #{id}")
    String getDictAreaNameById(@Param("id")Integer id);
    @Select("select id from ve_base_dict_area where name = #{name} and pid = #{pid}")
    Integer getDictIdByNameAndPid(@Param("pid")Integer pid,@Param("name")String name);
}
